import { createStore, applyMiddleware } from 'redux'
import  ThunkMiddleware  from "redux-thunk";
import createSagaMiddleware from 'redux-saga'
import reducer from './reducer.js'
import mySaga from './saga.js';

// 创建saga Middleware中间件
const sagaMiddleware = createSagaMiddleware()
// 应用一些中间件
const storEenhancer = applyMiddleware(ThunkMiddleware,sagaMiddleware)

const store = createStore(reducer, storEenhancer)

sagaMiddleware.run(mySaga)
// console.log(store);
export default store
